﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace wd_32_right_menu_v1
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Grid_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
        {
            //弹出右键菜单。
            System.Windows.Controls.ContextMenu NotifyIconMenu = (System.Windows.Controls.ContextMenu)this.FindResource("StucmButton");
            NotifyIconMenu.IsOpen = true;


            //App.Current.MainWindow.Activate();//当点击托盘图标后，会使应用失去焦点，本句使应用程序重新获取焦点 

//————————————————
//版权声明：本文为CSDN博主「eennddyy」的原创文章，遵循CC 4.0 BY - SA版权协议，转载请附上原文出处链接及本声明。
//原文链接：https://blog.csdn.net/eennddyy/article/details/79446279
        }
    }
}
